<include file="public@header"/>
</head>
<body style="background-color: #E5F3E6">
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
		<li><a href="{:url('ressim/ressim_info_index')}">安全管理制度</a></li>
			<li class="active"><a href="{:url('ressim/ressim_info_add')}">添加安全管理制度</a></li>
		</ul>
    <form class="form-horizontal  margin-top-20 " 
    >
	    <div class="form-group">
	            <label for="input-equimentType" class="col-sm-2 control-label"><span class="form-required">*</span>制度类别</label>
	            <div class="col-md-6 col-sm-10">
					 <select class="form-control" name="typeName" 
                     id="rssimTypeID">
	                    <foreach name="result_et" item="vo">
	                        <option  value="{$vo.rssimTypeID}">{$vo.typeName}</option>
	                    </foreach>
	                </select>
	            </div>
	        </div>
        <div class="form-group">
            <label for="input-typeName" class="col-sm-2 control-label"><span class="form-required">*</span>制度标题</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-titleName" 
                name="titleName">
            </div>
        </div>
        <div class="form-group">
            <label for="input-typeName" class="col-sm-2 control-label">
            <span class="form-required">*</span>制度内容</label>
            <div class="col-md-6 col-sm-10">
                <div id="ressimInfo" style="height: 350px;"></div>
            </div>
        </div>
    </form>
     <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button  onclick="textTestw()" 
                class="btn btn-primary ">保存</button>
            </div>
        </div>
</div>
<script src="__STATIC__/js/admin.js"></script>

<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('ressimInfo');
    ue.ready(function() {
        //设置编辑器的内容
        ue.setContent('');
        //获取html内容，返回: <p>hello</p>
        var html = ue.getContent();
        //获取纯文本内容，返回: hello
        var txt = ue.getContentTxt();
    });
</script>
<script>
    function textTestw(){
        /*制度类别*/
        var type_id = $('#rssimTypeID').val();
        /*标题* ,title_name:title_name,ressim_info:ressim_info*/
        var title_name = $('#input-titleName').val();
       
        var ressim_info = ue.getContent();
        $.ajax({
            url:"/index.php/admin/Ressim/ajaxRessimInfo",
            data:{type_id:type_id,title_name:title_name,ressim_info:ressim_info},
            type:"post",
            dataType:"json",
            success: function(data){
                var text = JSON.parse(data);
                alert("保存成功");
                //ue.setContent(text);
            }
        });
     }
</script>
</body>
</html>